import Request from "./../../core";

export const getModuleInfo = (data, pid = uni.getStorageSync("pageId")) => {
  return Request.get(
    `/marketing/lowCode/h5/getModuleById?pageId=${pid}`,
    data,
    {
      isLoading: false,
    }
  );
};

export const getPageJson = (data) => {
  return Request.get(`/marketing/lowCode/h5/getFormComponent`, data, {
    isLoading: false,
  });
};

export const uploadImage = (file, bid = uni.getStorageSync("businessId")) => {
  return Request.upload(
    `/marketing/from/upload?businessId=${bid}`,
    null,
    null,
    file
  );
};

export const getWxAppQrcode = (data) => {
  return Request.get(`/marketing/lowCode/h5/getWxappQrcode`, data);
};

export const getNearList = (data = {}) => {
  return Request.post(`/customerShop/anon/getShops`, data, {
    isLoading: false,
  });
};
export const getIndustry = (data = {}) => {
  return Request.get(`/customerShop/anon/getIndustry`, data, {
    isLoading: false,
  });
};

export default {
  getIndustry,
  getModuleInfo,
  uploadImage,
  getNearList,
};
